package joboo4;

public  abstract class  Animal2 {
    String name;
    int age;
    String colour;

    Animal2(String name,int age,String colour){
        this.name=name;
        this.age=age;
        this.colour=colour;
    }
    void drink(){
        System.out.println(colour+"色的"+age+"岁的"+name+"在喝水");
    }
    abstract void eat();
}
class Dog extends Animal2 implements Swim2 {
    Dog(String name,int age,String colour){
        super(name, age, colour);

    }
    void lookHome(){
        System.out.println(colour+"色"+age+"岁的小狗"+name+"在看家");
    }

    void eat(){
        System.out.println(colour+"色"+age+"岁的小狗"+name+"在吃骨头");
    }

    public void swim() {
        System.out.println(colour+"色"+age+"岁的小狗"+name+"正在游泳");
    }
}


class Chick extends Animal2 {

    Chick(String name,int age,String colour) {
        super(name, age, colour);
    }

    void layEaas(){
        System.out.println(colour + "色的" + age + "岁的小鸡" + name +"它正在下蛋");
    }

    void eat(){
        System.out.println(colour + "色的" + age + "岁的小鸡" + name + "它正在吃米");
    }
}


class Fish extends Animal2 implements Swim2 {
    Fish(String name, int age, String colour) {
        super(name, age, colour);
    }

    void eat() {
        System.out.println(colour + "色的" + age + "岁的小鱼" + name + "它正在吃虾");
    }

    @Override
    public void swim() {
        System.out.println(colour + "色的" + age + "岁的小鱼" + name + "它正在游泳");
    }
}
